package com.ncmmall.application.jobs;

import com.ncmmall.application.business.marketing.MarketingApplication;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * 营销定时任务
 *
 * @author linxs
 * @date 2019-07-22 10:28
 */
@Slf4j
public class AutoMarkJobApplication extends QuartzJobBean {

    private final MarketingApplication marketingApplication;

    public AutoMarkJobApplication(MarketingApplication marketingApplication) {
        this.marketingApplication = marketingApplication;
    }

    public void execute() {
        try {
            log.info("[营销定时任务启动]");
            marketingApplication.marketingJob();
            log.info("[营销定时任务执行完成]");
        } catch (Exception e) {
            log.error("[营销定时执行异常]", e);
        }
    }

    @Override
    protected void executeInternal(JobExecutionContext context) {

    }
}
